package com.ler.yrmall.search.api;

import com.ler.yrmall.basic.Result;
import com.ler.yrmall.search.dto.SearchResultDTO;
import com.ler.yrmall.search.dto.SkuEsModelDTO;
import com.ler.yrmall.search.request.SpuSearchRequest;

import java.util.List;

/**
 * @author Leron
 * @version 1.0
 */
public interface SearchApi {

    /**
     * 保存sku搜索信息到 es
     * @param skuList
     * @return
     */
    Result<?> saveSku(List<SkuEsModelDTO> skuList);

    /**
     * 删除 es 的商品
     * @param skuIds
     * @return
     */
    Result<Boolean> deleteSku(List<Long> skuIds);

    /**
     * 从 es 中查询spu信息
     * @param searchRequest
     * @return
     */
    Result<SearchResultDTO> searchSpu(SpuSearchRequest searchRequest);

}
